/* 本文件为代码块样式设置 */

@import "fonts.css";

/* ——————————————————————————————————————————基础设置——————————————————————————————————————————————— */

/* 代码块 */
#write .md-fences {
  /* border: 1px solid #F4F4F4; */
  -webkit-font-smoothing: initial;
  margin: 0.8rem 0 !important;
  padding: 0.3rem 0 !important;
  line-height: 1.43rem;
  /* 背景色 */
  background-color: #f5f9fd !important;
  font-family: Roboto Mono, Source Sans Pro, Monaco, courier, monospace !important;
  font-size: 0.85rem;
  word-wrap: normal;
  /* border: 2px solid #000; */
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.15);
  border-radius: 0.3em;
}

#write .CodeMirror-wrap .CodeMirror-code pre {
  padding-left: 12px;
  font-family: Consolas, "霞鹜文楷";
  font-size: 18.5px;
  border-radius: 5em;
}

/* 行间代码 */
#write code,
tt {
  margin: 0 2px;
  padding: 1.5px 5px;
  font-family: "Fira", "霞鹜文楷";
  color: rgb(238, 130, 42);
  background-color: #f3f4f4;
  border-radius: 0.2em;
  font-weight: normal;
  font-size: 19px;
}

#write .CodeMirror-gutters {
  border-color: #313335;
  border-right: 1.5px solid #999999;
}

/* ——————————————————————————————————————代码块各语言颜色设置———————————————————————————————————————— */

/* ported from https://codemirror.net/theme/material.css */
.cm-s-inner {
  background-color: #263238;
  color: rgb(0, 0, 0);
}

/* 代码块行号右侧竖线 */
/* #write .CodeMirror-gutters {
    border-right: 0.75px solid #59647c;
} */

.cm-s-inner .CodeMirror-gutters {
  /* background: #263238; */
  color: rgb(87, 127, 83);
  border: none;
}

.cm-s-inner .CodeMirror-guttermarker,
.cm-s-inner .CodeMirror-guttermarker-subtle,
/* 行号 */
.cm-s-inner .CodeMirror-linenumber {
  color: #999999;
  font-family: "Fira";
}

/* 代码块光标 */
.cm-s-inner .CodeMirror-cursor {
  border-left: 3px solid cornflowerblue !important;
}

/* 选中文字背景 */
.cm-s-inner div.CodeMirror-selected {
  background: rgba(255, 255, 255, 0.15);
}

.cm-s-inner.CodeMirror-focused div.CodeMirror-selected {
  background: rgba(255, 255, 255, 0.1);
}

.cm-s-inner .CodeMirror-line::selection,
.cm-s-inner .CodeMirror-line>span::selection,
.cm-s-inner .CodeMirror-line>span>span::selection {
  background: rgba(255, 255, 255, 0.1);
}

.cm-s-inner .CodeMirror-line::-moz-selection,
.cm-s-inner .CodeMirror-line>span::-moz-selection,
.cm-s-inner .CodeMirror-line>span>span::-moz-selection {
  background: rgba(255, 255, 255, 0.1);
}

/* 光标所在行背景色 */
/* .md-fences.md-focus .cm-s-inner .CodeMirror-activeline-background, */
.md-fences.md-focus .CodeMirror-code>div.CodeMirror-activeline{
  background: #eee;
}

/* 关键字 */
.cm-s-inner .cm-keyword {
  color: #8f08c4;
}

/* 运算符 */
.cm-s-inner .cm-operator {
  color: #36374c;
}

/* 被使用的形参 */
.cm-s-inner .cm-variable-2 {
  color: #80cbc4;
}

/* 形参,类型 */
.cm-s-inner .cm-variable-3 {
  color: #82b1ff;
}

/* 被调用的属性 */
.cm-s-inner .cm-builtin {
  color: #decb6b;
}

/* css属性值，布尔值等等 */
.cm-s-inner .cm-atom {
  color: #f77669;
}

/* 数字 */
.cm-s-inner .cm-number {
  color: #b4654d;
}

/* 变量名 */
.cm-s-inner .cm-def {
  color: #74531f;
}

/* 字符串 */
.cm-s-inner .cm-string {
  color: #b91919;
}

/* 正则表达式 */
.cm-s-inner .cm-string-2 {
  color: #80cbc4;
}

/* 注释 */
.cm-s-inner .cm-comment {
  color: #546e7a;
}

/* 被使用的变量名 */
.cm-s-inner .cm-variable {
  color: #000000;
}

/* 标签名 */
.cm-s-inner .cm-tag {
  color: #80cbc4;
}

/* 省略号,注解等 */
.cm-s-inner .cm-meta {
  color: #e96900;
}

/* 属性 */
.cm-s-inner .cm-attribute {
  color: #ffcb6b;
}

/* 被调用的方法 */
.cm-s-inner .cm-property {
  color: #80cbae;
}

/* css class */
.cm-s-inner .cm-qualifier {
  color: #decb6b;
}

/* 形参,类型 */
.cm-s-inner .cm-variable-3 {
  color: #0000ff;
}

.cm-s-inner .cm-tag {
  color: rgba(255, 83, 112, 1);
}

/* 错误 */
.cm-s-inner .cm-error {
  color: rgba(255, 255, 255, 1);
  background-color: #ec5f67;
}

.cm-s-inner .CodeMirror-matchingbracket {
  text-decoration: underline;
  color: white !important;
}

.md-fences {
  background-color: #263238;
  color: rgb(44, 116, 199);
  border: none;
}

.cm-s-inner .cm-link,
.cm-s-inner.cm-link {
  color: #22a2c9;
}

.cm-s-inner .cm-string {
  color: #a31515;
}

.md-fences .code-tooltip {
  background-color: #ffffff;
}

/* diff 样式，仿GitHub */
.cm-negative {
  color: #82071e;
  background-color: #ffebe9;
}

.cm-positive {
  color: #116329;
  background-color: #dafbe1;
}